package com.springlog.demo.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/log")
public class LogController {
    private final static Logger logger= LoggerFactory.getLogger(LogController.class);

    @RequestMapping("/print")
    public String print() {
        System.out.println("sout 打印日志");
        logger.info("logger 打印日志");
        logger.trace("trace 打印日志");
        logger.debug("debug 打印日志");
        logger.warn("warn 打印日志");
        logger.error("error 打印日志");
        return "打印日志";
    }
}